EOF
EOFW

Syntax: EOF [(#ch)]
   and: EOFW (#ch)              SMS only
Location: QL ROM

This is a logical function which actually has two uses in SuperBASIC. If no channel number is specified, then PRINT EOF will return 1 unless the current program contains some DATA lines which have not yet been READ. This is therefore useful to create programs which can handle any amount of data.

However, if a channel number is specified, for example PRINT EOF(#1), then zero will be returned unless the given channel is linked to a file and the file pointer is at (or beyond) the end of that file (ie. whether or not there is data to be read from that channel).

EOFW is similar - it returns 0 if there is data waiting to be read from the specified channel, otherwise it returns 0.  However, EOFW waits until data or an end of file is received from the channel.

CROSS-REFERENCE:
DATA specifies a line of data statements. RESTORE resets the data pointer and READ will actually fetch the data. CLOSE closes a given channel after it has been used. PEND or IO_PEND% are much better for use on pipes.
